package myJs.user.mission

import myJs.Implicits._
import myJs.Utils._

import scala.scalajs.js.Dynamic.{global => g}
import myJs.myPkg.bootstrap.Bootstrap.default._
import myJs.myPkg.jquery._
import myJs.myPkg.{LayerOptions, MiniColorsOptions}
import myJs.tool.Tool
import myJs.tool.Tool._
import myJs.user.mission.plot._
import org.scalajs.dom.ext.Ajax
import org.scalajs.dom.{Element, document}
import scalatags.Text.all._

import org.scalajs.macrotaskexecutor.MacrotaskExecutor.Implicits._
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSExport, JSExportTopLevel}
import scala.scalajs.js.{Date, UndefOr}
import scala.scalajs.js.JSConverters._

/**
 * Created by yz on 2019/4/25
 */
@JSExportTopLevel("LimmaAnaResult")
object LimmaAnaResult extends MissionResult {


  @JSExport("init")
  def init = {
    refreshMissionInfo(getMissionId)
    refreshFileInfo(getMissionId)
    registerEvent

    selfInit

//    Tool.selectTab("score")
//    Tool.selectArgTab("scoreLayout")

  }

  def selfInit = {
    Tool.initMiniColors
  }

  def myToggle(tabId: String) = {
    $(s"#${tabId} #content").toggleClass("col-sm-12 col-sm-8")
    $(s"#${tabId} #sidebar").toggleClass("collapsed")
    $(s"#${tabId} .myToggle i").toggleClass("fa-angle-double-right fa-angle-double-left")
  }

  def getMissionId = {
    g.missionId.toString
  }

}
